unit uiWizard;

interface

uses
  Forms, Controls;

const
  { Wizard button type constants }
  wbt_Next   = 0;  // -- Next button
  wbt_Prev   = 1;  // -- Previous button
  wbt_Ok     = 2;  // -- Ok button
  wbt_Cancel = 3;  // -- Cancel Button
  wbt_First  = 4;  // -- First button
  wbt_Finish = 5;  // -- Finish button
  wbt_Clear  = 6;  // -- Clear button
  wbt_Save   = 7;  // -- Save button

type
  {IWizardManager is implemented by the wizard main form and is the
   engine interface which performs all of the work.}
  IWizardManager = interface
    ['{E78DD157-CCAF-48A3-BC4C-C0438514C898}']
    procedure NavigateToPage(ClassName:String;PushToStack:boolean=true);
    procedure PopStackToPage(ClassName:String);
    procedure SetNextEnabled(bEnabled:boolean);
    procedure SetPrevEnabled(bEnabled:boolean);
    procedure SetNextType(iType:integer;Caption:string='');
    procedure SetPrevType(iType:integer;Caption:string='');
    function CurForm : tForm;
    procedure SetAllowDeletion(Active:Boolean);
  end;

  { IWizardPage must be implemented by all wizard pages }
  IWizardPage = interface
    ['{D4CD1932-9ACF-4503-8E66-6011975AB2E5}']
    procedure SetWizardManager(Mgr:IWizardManager);
  end;

  { any wizard page which will need to handle the next/finished
    button MUST implement this interface, or the button will not
    be visible. }
  IWizardNextPage = interface
    ['{B7222688-67F1-4A19-BFBB-6592D6754FB1}']
    procedure NextPageEvent;
  end;

  { Optional interface.  If not implemented, then the previous
    page displayed will be popped off the stack. otherwise this allows
    an override event to be placed in the system }
  IWizardPrevPage = interface
    ['{DB700565-299B-4291-8CDA-4FBAF82857D4}']
    procedure PrevPageEvent(var PopPageStack:boolean);
  end;

  { Optional interface.  If implemented can be used to route the F1 help key
    or button from the main form to display the appropriate help text }
  IWizardHelp = interface
    ['{C456CC7A-E4F0-43E8-8F5A-1ED27CC19A47}']
    function GetHelpBookmark : string;
  end;

  { Optional interface.  Implement this to specify which control should
    be focused when the page is displayed. }
  IWizardFocusControl = interface
    ['{B02A8D06-8720-4709-860E-43FE54F64AAA}']
    function InitialFocusControl : tWinControl;
  end;

  { Optional interface.  Is ALWAYS called when a page is navigated away from,
    reguardless of the direction.  It is more common to implement the save
    logic on the NextPageEvent event, however for some complicated screens, it
    might be desirable to also save on the previous button click }
  IWizardSaveState = interface
    ['{4A93FFD5-C38A-42AA-A442-33B8F19197EB}']
    procedure SaveState;
  end;

  { Optional interface.  This interface does nothing but signify to the wizard
    framework that this page is the exit page, and pressing the next button on
    this page will close the wizard.  If data needs to be saved, then also
    implement the INextWizardPage or IWizardSaveState interface, which will be
    called prior to this one. }
  IWizardExitPage = interface
    ['{C4EA0B2E-7774-44AC-B015-388A9836B4AC}']
  end;

implementation

end.
